package com.yc.store;

import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;

import javax.servlet.ServletException;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/4/25
 * Email haijunzhou@hnit.edu.cn
 */
public class MyWebApplicationInitializer implements WebApplicationInitializer {
    @Override
    public void onStartup(javax.servlet.ServletContext servletContext) throws ServletException {
        AnnotationConfigWebApplicationContext cxt =
                new AnnotationConfigWebApplicationContext();
        cxt.register(StoreConfig.class);
        // 添加 Spring Servlet应用上下文监听器
        servletContext.addListener(ContextLoaderListener.class);
    }
}
